//
//  BCOrderSendCollectionViewCell.m
//  BangcaiSale
//
//  Created by Liang Zhang on 16/7/9.
//  Copyright © 2016年 Bangcai. All rights reserved.
//

#import "BCOrderSendCollectionViewCell.h"

@implementation BCOrderSendCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    //临时数据
    NSString *stuffCount = @"5";
    
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.countLable.text];
    UIColor *textColor = [UIColor colorWithRed:0.933 green:0.310 blue:0.247 alpha:1.000];
    [attributedString addAttribute:NSForegroundColorAttributeName  //文字颜色
                             value:[UIColor darkGrayColor]
                             range:NSMakeRange(0, @"共".length)];
    [attributedString addAttribute:NSForegroundColorAttributeName  //文字颜色
                             value:textColor
                             range:NSMakeRange(@"共".length, stuffCount.length)];
    [attributedString addAttribute:NSForegroundColorAttributeName  //文字颜色
                             value:[UIColor darkGrayColor]
                             range:NSMakeRange(@"共".length+stuffCount.length, @"件商品".length)];
    self.countLable.attributedText = attributedString;
}

+ (instancetype)cellWithCollectionView:(UICollectionView *)collectionView {
    static NSString *ID = @"OrderSendCellIdentifer";
    UINib *nib = [UINib nibWithNibName:@"BCOrderSendCollectionViewCell" bundle: [NSBundle mainBundle]];
    [collectionView registerNib:nib forCellWithReuseIdentifier:ID];
    BCOrderSendCollectionViewCell *cell = [[BCOrderSendCollectionViewCell alloc] init];
    return cell;
}

@end
